
Blockly.Blocks['time_package'] = {
    init: function() {
        this.appendDummyInput()
            .appendField('导入 time');
        this.setOutput(false);
        this.setColour('%{BKY_TIME_HUE}');
        this.setNextStatement(true);
        this.setPreviousStatement(true);
        this.setTooltip('导入 time 包');
        this.setHelpUrl('');
    }
};

Blockly.Blocks['time_sleep'] = {
    init: function() {
        this.appendDummyInput()
            .appendField('休眠 ')
            .appendField(new Blockly.FieldNumber(1), 'SECOND')
            .appendField(' 秒');
        this.setOutput(false);
        this.setColour('%{BKY_TIME_HUE}');
        this.setNextStatement(true);
        this.setPreviousStatement(true);
        this.setTooltip('休眠一段时间');
        this.setHelpUrl('');
    }
};